3.1.68 \(\int \frac {\cos ^2(c+d x)}{(a+a \sin (c+d x))^2} \, dx\) [68]

Optimal. Leaf size=34 \[ -\frac {x}{a^2}-\frac {2 \cos (c+d x)}{d \left (a^2+a^2 \sin (c+d x)\right )} \]

[Out]

-x/a^2-2*cos(d*x+c)/d/(a^2+a^2*sin(d*x+c))

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 34, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {2759, 8} \begin {gather*} -\frac {2 \cos (c+d x)}{d \left (a^2 \sin (c+d x)+a^2\right )}-\frac {x}{a^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^2/(a + a*Sin[c + d*x])^2,x]

[Out]

-(x/a^2) - (2*Cos[c + d*x])/(d*(a^2 + a^2*Sin[c + d*x]))

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2759

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Simp[2*g*(g
*Cos[e + f*x])^(p - 1)*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(2*m + p + 1))), x] + Dist[g^2*((p - 1)/(b^2*(2*m +
p + 1))), Int[(g*Cos[e + f*x])^(p - 2)*(a + b*Sin[e + f*x])^(m + 2), x], x] /; FreeQ[{a, b, e, f, g}, x] && Eq
Q[a^2 - b^2, 0] && LeQ[m, -2] && GtQ[p, 1] && NeQ[2*m + p + 1, 0] &&  !ILtQ[m + p + 1, 0] && IntegersQ[2*m, 2*
p]

Rubi steps

\begin {align*} \int \frac {\cos ^2(c+d x)}{(a+a \sin (c+d x))^2} \, dx &=-\frac {2 \cos (c+d x)}{d \left (a^2+a^2 \sin (c+d x)\right )}-\frac {\int 1 \, dx}{a^2}\\ &=-\frac {x}{a^2}-\frac {2 \cos (c+d x)}{d \left (a^2+a^2 \sin (c+d x)\right )}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(104\) vs. \(2(34)=68\).
time = 0.11, size = 104, normalized size = 3.06 \begin {gather*} \frac {2 \cos ^3(c+d x) \left ((-1+\sin (c+d x)) \sqrt {1+\sin (c+d x)}+\sin ^{-1}\left (\frac {\sqrt {1-\sin (c+d x)}}{\sqrt {2}}\right ) \sqrt {1-\sin (c+d x)} (1+\sin (c+d x))\right )}{a^2 d (-1+\sin (c+d x))^2 (1+\sin (c+d x))^{5/2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^2/(a + a*Sin[c + d*x])^2,x]

[Out]

(2*Cos[c + d*x]^3*((-1 + Sin[c + d*x])*Sqrt[1 + Sin[c + d*x]] + ArcSin[Sqrt[1 - Sin[c + d*x]]/Sqrt[2]]*Sqrt[1
- Sin[c + d*x]]*(1 + Sin[c + d*x])))/(a^2*d*(-1 + Sin[c + d*x])^2*(1 + Sin[c + d*x])^(5/2))

________________________________________________________________________________________

Maple [A]
time = 0.20, size = 37, normalized size = 1.09

method result size
risch \(-\frac {x}{a^{2}}-\frac {4}{d \,a^{2} \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}\) \(30\)
derivativedivides \(\frac {-2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {4}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}}{a^{2} d}\) \(37\)
default \(\frac {-2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {4}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}}{a^{2} d}\) \(37\)
norman \(\frac {-\frac {4}{a d}-\frac {8 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d a}-\frac {4 \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}-\frac {12 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}-\frac {8 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}-\frac {16 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}-\frac {12 \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d a}-\frac {x}{a}-\frac {3 x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a}-\frac {5 x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {7 x \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {7 x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {5 x \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {3 x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {x \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} a \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}\) \(277\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^2/(a+a*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

2/d/a^2*(-arctan(tan(1/2*d*x+1/2*c))-2/(tan(1/2*d*x+1/2*c)+1))

________________________________________________________________________________________

Maxima [A]
time = 0.53, size = 56, normalized size = 1.65 \begin {gather*} -\frac {2 \, {\left (\frac {2}{a^{2} + \frac {a^{2} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}} + \frac {\arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}}\right )}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2/(a+a*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

-2*(2/(a^2 + a^2*sin(d*x + c)/(cos(d*x + c) + 1)) + arctan(sin(d*x + c)/(cos(d*x + c) + 1))/a^2)/d

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 61, normalized size = 1.79 \begin {gather*} -\frac {d x + {\left (d x + 2\right )} \cos \left (d x + c\right ) + {\left (d x - 2\right )} \sin \left (d x + c\right ) + 2}{a^{2} d \cos \left (d x + c\right ) + a^{2} d \sin \left (d x + c\right ) + a^{2} d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2/(a+a*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

-(d*x + (d*x + 2)*cos(d*x + c) + (d*x - 2)*sin(d*x + c) + 2)/(a^2*d*cos(d*x + c) + a^2*d*sin(d*x + c) + a^2*d)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 95 vs. \(2 (29) = 58\).
time = 2.67, size = 95, normalized size = 2.79 \begin {gather*} \begin {cases} - \frac {d x \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{a^{2} d \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )} + a^{2} d} - \frac {d x}{a^{2} d \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )} + a^{2} d} - \frac {4}{a^{2} d \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )} + a^{2} d} & \text {for}\: d \neq 0 \\\frac {x \cos ^{2}{\left (c \right )}}{\left (a \sin {\left (c \right )} + a\right )^{2}} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**2/(a+a*sin(d*x+c))**2,x)

[Out]

Piecewise((-d*x*tan(c/2 + d*x/2)/(a**2*d*tan(c/2 + d*x/2) + a**2*d) - d*x/(a**2*d*tan(c/2 + d*x/2) + a**2*d) -
 4/(a**2*d*tan(c/2 + d*x/2) + a**2*d), Ne(d, 0)), (x*cos(c)**2/(a*sin(c) + a)**2, True))

________________________________________________________________________________________

Giac [A]
time = 7.75, size = 33, normalized size = 0.97 \begin {gather*} -\frac {\frac {d x + c}{a^{2}} + \frac {4}{a^{2} {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2/(a+a*sin(d*x+c))^2,x, algorithm="giac")

[Out]

-((d*x + c)/a^2 + 4/(a^2*(tan(1/2*d*x + 1/2*c) + 1)))/d

________________________________________________________________________________________

Mupad [B]
time = 4.64, size = 28, normalized size = 0.82 \begin {gather*} -\frac {x}{a^2}-\frac {4}{a^2\,d\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)^2/(a + a*sin(c + d*x))^2,x)

[Out]

- x/a^2 - 4/(a^2*d*(tan(c/2 + (d*x)/2) + 1))

________________________________________________________________________________________